package com.kedacom.freedomLabel.initdata.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;


import com.kedacom.freedomLabel.initdata.bean.Goods;
import com.kedacom.freedomLabel.initdata.bean.Team;
import com.kedacom.freedomLabel.model.db.dao.IDao;

import java.util.List;

/**
 * Created by yao on 2021/3/23.
 * Describe
 */
@Dao
public interface TeamDao extends IDao<Team> {

    @Override
    @Query("SELECT COUNT(0) FROM Team")
    int count();

    @Override
    @Update
    void update(Team data);

    @Override
    @Insert(onConflict = OnConflictStrategy.FAIL)
    long save(Team data);

    @Override
    @Insert(onConflict = OnConflictStrategy.FAIL)
    long[] save(List<Team> data);

    @Override
    @Query("SELECT * FROM Team ORDER BY teamId DESC")
    List<Team> get();

    @Override
    @Query("SELECT * FROM Team WHERE teamName like '%' || :param || '%'")
    List<Team> get(String param);

    @Override
    @Query("SELECT * FROM Team WHERE teamName=:param1 and teamName LIKE :param2")
    List<Team> get(String param1, String param2);

    @Override
    @Delete
    void delete(Team data);

    @Override
    @Query("DELETE FROM Team")
    void delete();

    @Override
    @Query("DELETE FROM Team WHERE teamName=:param ")
    void delete(String param);

//    @Query("SELECT * FROM Team")
//    List<Team> getAllTeam();
//
//    @Query("SELECT * FROM Team WHERE teamId=:teamId")
//    Team getAllTeamByTeamId(String teamId);
//
//    @Insert
//    void insert(List<Team> classesList);
//
//    @Delete
//    void delete(List<Team> classesList);
}
